//
//  GoodsTopTableViewCell.m
//  MyProject
//
//  Created by dllo on 15/10/29.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "GoodsTopTableViewCell.h"

@implementation GoodsTopTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.flowlayout = [[UICollectionViewFlowLayout alloc]init];
        self.flowlayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
        self.collectionView = [[UICollectionView alloc]initWithFrame:self.contentView.bounds collectionViewLayout:self.flowlayout];
        self.collectionView.backgroundColor = [UIColor colorWithRed:200/225.0 green:200/225.0 blue:200/225.0 alpha:1];
        [self.contentView addSubview:_collectionView];
    }
    return self;
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    self.flowlayout.itemSize = CGSizeMake((self.contentView.bounds.size.width - 40)/4, (self.contentView.bounds.size.width - 40)/4);
    self.flowlayout.minimumLineSpacing = 10;
    self.flowlayout.minimumInteritemSpacing = 5;
    self.flowlayout.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10);
    self.collectionView.frame = self.contentView.bounds;
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
